working of dc motor